package com.example.xyxwebbackend001.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.xyxwebbackend001.service.ComService;

@Component
public class DraftCleanupTask {

    @Autowired
    private ComService comService;

    @Scheduled(fixedRate = 30 * 60 * 1000)
    public void cleanupUnfinishedPosts() {
        int count = comService.cleanupExpiredDrafts();
    }
}